<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Flow-IPC: ipc::transport::struc::Channel&lt; Channel_obj, Message_body, Struct_builder_config, Struct_reader_config &gt;::Sync_op_state Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Flow-IPC<span id="projectnumber">&#160;2.0.0</span>
   </div>
   <div id="projectbrief">Flow-IPC project: Full implementation reference.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceipc.html">ipc</a></li><li class="navelem"><a class="el" href="namespaceipc_1_1transport.html">transport</a></li><li class="navelem"><a class="el" href="namespaceipc_1_1transport_1_1struc.html">struc</a></li><li class="navelem"><a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html">Channel</a></li><li class="navelem"><a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html">Sync_op_state</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">ipc::transport::struc::Channel&lt; Channel_obj, Message_body, Struct_builder_config, Struct_reader_config &gt;::Sync_op_state Struct Reference</div></div>
</div><!--header-->
<div class="contents">

<p>State in <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html#ab40d8133d53135bcc41a12cc27fc8e13" title="The current state of the blocking sync-op mechanism; a variant that broadly describes the state as: n...">m_sync_op_state</a>, when a sync-op is in fact in progress, meaning <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html#ab40d8133d53135bcc41a12cc27fc8e13" title="The current state of the blocking sync-op mechanism; a variant that broadly describes the state as: n...">m_sync_op_state</a> is not null.  
 <a href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#details">More...</a></p>
<div class="dynheader">
Collaboration diagram for ipc::transport::struc::Channel&lt; Channel_obj, Message_body, Struct_builder_config, Struct_reader_config &gt;::Sync_op_state:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state__coll__graph.svg" width="512" height="168"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state_1_1Request__result.html">Request_result</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A successul result of <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html#aa41aee3c76035f43833078e625e6ef78" title="Equivalent to the other sync_request() overload but with no timeout; meaning it shall exit only once ...">sync_request()</a>.  <a href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state_1_1Request__result.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-types" name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a6b5142da7049fc212faff3914e69379b"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#a6b5142da7049fc212faff3914e69379b">id_t</a> = unsigned int</td></tr>
<tr class="memdesc:a6b5142da7049fc212faff3914e69379b"><td class="mdescLeft">&#160;</td><td class="mdescRight">ID of each sync operation: a distinct value is used each time a <code>*this</code> is created/placed into <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html#ab40d8133d53135bcc41a12cc27fc8e13" title="The current state of the blocking sync-op mechanism; a variant that broadly describes the state as: n...">m_sync_op_state</a>.  <a href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#a6b5142da7049fc212faff3914e69379b">More...</a><br /></td></tr>
<tr class="separator:a6b5142da7049fc212faff3914e69379b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:ad6f8e016b2abc3654e1915cc8c77c268"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#a6b5142da7049fc212faff3914e69379b">id_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#ad6f8e016b2abc3654e1915cc8c77c268">m_id</a></td></tr>
<tr class="memdesc:ad6f8e016b2abc3654e1915cc8c77c268"><td class="mdescLeft">&#160;</td><td class="mdescRight">See <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#a6b5142da7049fc212faff3914e69379b" title="ID of each sync operation: a distinct value is used each time a *this is created/placed into m_sync_o...">id_t</a>; used to check an arriving sync op result as belonging to the currently-waiting sync op.  <a href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#ad6f8e016b2abc3654e1915cc8c77c268">More...</a><br /></td></tr>
<tr class="separator:ad6f8e016b2abc3654e1915cc8c77c268"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac8c083b7c861d00e2f987a017fbe994e"><td class="memItemLeft" align="right" valign="top">std::variant&lt; std::monostate, <a class="el" href="namespaceipc.html#aa3192e586cc45d3e7c22463bf2760f89">Error_code</a>, <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state_1_1Request__result.html">Request_result</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#ac8c083b7c861d00e2f987a017fbe994e">m_result_if_any</a></td></tr>
<tr class="memdesc:ac8c083b7c861d00e2f987a017fbe994e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Current state of the in-progress sync-op (as of this writing, there is only <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html#aa41aee3c76035f43833078e625e6ef78" title="Equivalent to the other sync_request() overload but with no timeout; meaning it shall exit only once ...">sync_request()</a>).  <a href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#ac8c083b7c861d00e2f987a017fbe994e">More...</a><br /></td></tr>
<tr class="separator:ac8c083b7c861d00e2f987a017fbe994e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c49d5ee9989c5c0dc518868205687f0"><td class="memItemLeft" align="right" valign="top">boost::promise&lt; void &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#a5c49d5ee9989c5c0dc518868205687f0">m_op_done_signal</a></td></tr>
<tr class="memdesc:a5c49d5ee9989c5c0dc518868205687f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">In-traffic processing thread W, having set <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#ac8c083b7c861d00e2f987a017fbe994e" title="Current state of the in-progress sync-op (as of this writing, there is only sync_request()).">m_result_if_any</a> to non-<code>monostate</code>, use <code>m_op_done_signal.set_value(void)</code> to signal thread U to wake up from <code>m_op_done_signal.get_future().wait*()</code>.  <a href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#a5c49d5ee9989c5c0dc518868205687f0">More...</a><br /></td></tr>
<tr class="separator:a5c49d5ee9989c5c0dc518868205687f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;typename Channel_obj, typename Message_body, typename Struct_builder_config, typename Struct_reader_config&gt;<br />
struct ipc::transport::struc::Channel&lt; Channel_obj, Message_body, Struct_builder_config, Struct_reader_config &gt;::Sync_op_state</div><p >State in <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html#ab40d8133d53135bcc41a12cc27fc8e13" title="The current state of the blocking sync-op mechanism; a variant that broadly describes the state as: n...">m_sync_op_state</a>, when a sync-op is in fact in progress, meaning <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html#ab40d8133d53135bcc41a12cc27fc8e13" title="The current state of the blocking sync-op mechanism; a variant that broadly describes the state as: n...">m_sync_op_state</a> is not null. </p>
<p >See discussion in <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html#ab40d8133d53135bcc41a12cc27fc8e13" title="The current state of the blocking sync-op mechanism; a variant that broadly describes the state as: n...">m_sync_op_state</a> doc header. </p>

<p class="definition">Definition at line <a class="el" href="ipc__transport__structured_2src_2ipc_2transport_2struc_2channel_8hpp_source.html#l01363">1363</a> of file <a class="el" href="ipc__transport__structured_2src_2ipc_2transport_2struc_2channel_8hpp_source.html">channel.hpp</a>.</p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="a6b5142da7049fc212faff3914e69379b" name="a6b5142da7049fc212faff3914e69379b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6b5142da7049fc212faff3914e69379b">&#9670;&nbsp;</a></span>id_t</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Channel_obj , typename Message_body , typename Struct_builder_config , typename Struct_reader_config &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html">ipc::transport::struc::Channel</a>&lt; Channel_obj, Message_body, Struct_builder_config, Struct_reader_config &gt;::Sync_op_state::id_t =  unsigned int</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>ID of each sync operation: a distinct value is used each time a <code>*this</code> is created/placed into <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html#ab40d8133d53135bcc41a12cc27fc8e13" title="The current state of the blocking sync-op mechanism; a variant that broadly describes the state as: n...">m_sync_op_state</a>. </p>

<p class="definition">Definition at line <a class="el" href="ipc__transport__structured_2src_2ipc_2transport_2struc_2channel_8hpp_source.html#l01368">1368</a> of file <a class="el" href="ipc__transport__structured_2src_2ipc_2transport_2struc_2channel_8hpp_source.html">channel.hpp</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="ad6f8e016b2abc3654e1915cc8c77c268" name="ad6f8e016b2abc3654e1915cc8c77c268"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad6f8e016b2abc3654e1915cc8c77c268">&#9670;&nbsp;</a></span>m_id</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Channel_obj , typename Message_body , typename Struct_builder_config , typename Struct_reader_config &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#a6b5142da7049fc212faff3914e69379b">id_t</a> <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html">ipc::transport::struc::Channel</a>&lt; Channel_obj, Message_body, Struct_builder_config, Struct_reader_config &gt;::Sync_op_state::m_id</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>See <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#a6b5142da7049fc212faff3914e69379b" title="ID of each sync operation: a distinct value is used each time a *this is created/placed into m_sync_o...">id_t</a>; used to check an arriving sync op result as belonging to the currently-waiting sync op. </p>

<p class="definition">Definition at line <a class="el" href="ipc__transport__structured_2src_2ipc_2transport_2struc_2channel_8hpp_source.html#l01380">1380</a> of file <a class="el" href="ipc__transport__structured_2src_2ipc_2transport_2struc_2channel_8hpp_source.html">channel.hpp</a>.</p>

</div>
</div>
<a id="a5c49d5ee9989c5c0dc518868205687f0" name="a5c49d5ee9989c5c0dc518868205687f0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5c49d5ee9989c5c0dc518868205687f0">&#9670;&nbsp;</a></span>m_op_done_signal</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Channel_obj , typename Message_body , typename Struct_builder_config , typename Struct_reader_config &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">boost::promise&lt;void&gt; <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html">ipc::transport::struc::Channel</a>&lt; Channel_obj, Message_body, Struct_builder_config, Struct_reader_config &gt;::Sync_op_state::m_op_done_signal</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>In-traffic processing thread W, having set <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#ac8c083b7c861d00e2f987a017fbe994e" title="Current state of the in-progress sync-op (as of this writing, there is only sync_request()).">m_result_if_any</a> to non-<code>monostate</code>, use <code>m_op_done_signal.set_value(void)</code> to signal thread U to wake up from <code>m_op_done_signal.get_future().wait*()</code>. </p>
<p >Thread U will then lock <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html#a01c90903e715ebcf64d8b5ea0d114bc0" title="Mutex protecting the in-message/out-message state in *this.">m_mutex</a> and examine the situation:</p><ul>
<li>If <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#ac8c083b7c861d00e2f987a017fbe994e" title="Current state of the in-progress sync-op (as of this writing, there is only sync_request()).">m_result_if_any</a> is <code>monostate</code>: Timeout.</li>
<li>If <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#ac8c083b7c861d00e2f987a017fbe994e" title="Current state of the in-progress sync-op (as of this writing, there is only sync_request()).">m_result_if_any</a> is <code>Error_code</code>: Got result in time, though it was pipe-hosing error.</li>
<li>If <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#ac8c083b7c861d00e2f987a017fbe994e" title="Current state of the in-progress sync-op (as of this writing, there is only sync_request()).">m_result_if_any</a> is something else: Got successful result in time.</li>
</ul>
<p >It then nullifies the entire <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html" title="State in m_sync_op_state, when a sync-op is in fact in progress, meaning m_sync_op_state is not null.">Sync_op_state</a>, unlocks mutex, and returns the result (timeout, error, or success payload) from <code>sync_*()</code>.</p>
<p >Note that <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#a5c49d5ee9989c5c0dc518868205687f0" title="In-traffic processing thread W, having set m_result_if_any to non-monostate, use m_op_done_signal....">m_op_done_signal</a> is not state, really, but 100% a signaling device. Its purpose is for thread W to wake thread U instead of waiting until the timeout period elapses, so that it may return the result as quickly as it is available. </p>

<p class="definition">Definition at line <a class="el" href="ipc__transport__structured_2src_2ipc_2transport_2struc_2channel_8hpp_source.html#l01408">1408</a> of file <a class="el" href="ipc__transport__structured_2src_2ipc_2transport_2struc_2channel_8hpp_source.html">channel.hpp</a>.</p>

</div>
</div>
<a id="ac8c083b7c861d00e2f987a017fbe994e" name="ac8c083b7c861d00e2f987a017fbe994e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac8c083b7c861d00e2f987a017fbe994e">&#9670;&nbsp;</a></span>m_result_if_any</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Channel_obj , typename Message_body , typename Struct_builder_config , typename Struct_reader_config &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">std::variant&lt;std::monostate, <a class="el" href="namespaceipc.html#aa3192e586cc45d3e7c22463bf2760f89">Error_code</a>, <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state_1_1Request__result.html">Request_result</a>&gt; <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html">ipc::transport::struc::Channel</a>&lt; Channel_obj, Message_body, Struct_builder_config, Struct_reader_config &gt;::Sync_op_state::m_result_if_any</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Current state of the in-progress sync-op (as of this writing, there is only <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html#aa41aee3c76035f43833078e625e6ef78" title="Equivalent to the other sync_request() overload but with no timeout; meaning it shall exit only once ...">sync_request()</a>). </p>
<ul>
<li><code>monostate</code>: It is in progress; result unknown.</li>
<li><code>Error_code</code>: It finished due to pipe-hosing error which is this truthy <code>Error_code</code>.</li>
<li><code><a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state_1_1Request__result.html" title="A successul result of sync_request().">Request_result</a></code>: It finished due to receiving response matching <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel_1_1Sync__op__state.html#ad6f8e016b2abc3654e1915cc8c77c268" title="See id_t; used to check an arriving sync op result as belonging to the currently-waiting sync op.">m_id</a>; that response is inside. (If more sync-op APIs are added over time, more <code>variant</code> types may be added to express results of other ops than <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html#aa41aee3c76035f43833078e625e6ef78" title="Equivalent to the other sync_request() overload but with no timeout; meaning it shall exit only once ...">sync_request()</a>.) </li>
</ul>

<p class="definition">Definition at line <a class="el" href="ipc__transport__structured_2src_2ipc_2transport_2struc_2channel_8hpp_source.html#l01390">1390</a> of file <a class="el" href="ipc__transport__structured_2src_2ipc_2transport_2struc_2channel_8hpp_source.html">channel.hpp</a>.</p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>transport/struc/<a class="el" href="ipc__transport__structured_2src_2ipc_2transport_2struc_2channel_8hpp_source.html">channel.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 11 2025 20:02:27 for Flow-IPC by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>
